{{Extend "layout"}}
{{Block "title"}}{{"任务日志"|T}}{{/Block}}
{{Block "breadcrumb"}}
{{Super}}
<li><a href="/task/index">{{"任务管理"|T}}</a></li>
<li class="active">{{"任务日志"|T}}
{{if Stored.task}}
({{"任务"|T}}: <a href="/task/edit?id={{Stored.task.Id}}">{{Stored.task.Name}} #{{Stored.task.Id}}</a>)
{{end}}
</li>
{{/Block}}
{{Block "main"}}
<div class="row">
				<div class="col-md-12">
					<div class="block-flat">
						<div class="header">							
							<h3>{{"任务日志"|T}}</h3>
						</div>
						<div class="content">
							<div class="table-responsive">
							<table class="table no-border hover">
								<thead class="no-border">
									<tr>
										<th style="width:2%;"><strong>ID</strong></th>
										<th style="width:15%;"><strong>{{"启动时间"|T}}</strong></th>
										<th style="width:15%;"><strong>{{"耗时"|T}}</strong></th>
										<th><strong>{{"输出"|T}}</strong></th>
										<th style="width:6%;"><strong>{{"状态"|T}}</strong></th>
										<th style="width:15%;" class="text-center"><strong>{{"操作"|T}}</strong></th>
									</tr>
								</thead>
								<tbody class="no-border-y">
                                    {{range $k,$v := Stored.listData}}
									<tr>
										<td>{{$v.Id}}</td>
										<td>{{$v.Created|Ts2date "2006-01-02 15:04:05"}}</td>
										<td>{{$v.Elapsed|FriendlyTime}}</td>
										<td>{{len $v.Output|FormatByte}}</td>
                                        {{if eq $v.Status "success"}}
										<td class="color-success"><span class="fa fa-check-circle"></span> {{"成功"|T}}</td>
										{{else if eq $v.Status "failure"}}
										<td class="color-danger"><span class="fa fa-times-circle"></span> {{"出错"|T}}</td>
										{{else if eq $v.Status "timeout"}}
										<td class="color-warning"><span class="fa fa-times-circle"></span> {{"超时"|T}}</td>
										{{else if eq $v.Status "stop"}}
										<td class="color-info"><span class="fa fa-info-circle"></span> {{"停止"|T}}</td>
										{{else if eq $v.Status "restart"}}
										<td class="color-info"><span class="fa fa-info-circle"></span> {{"重启"|T}}</td>
                                        {{else}}
                                        <td class="color-default">{{"未知"|T}}</td>
                                        {{end}}
										<td class="text-center">
										<a class="label label-info" href="/task/log_view/{{$v.Id}}"><i class="fa fa-comment-o"></i></a>
										<a class="label label-danger" href="/task/log_delete?id={{$v.Id}}" onclick="return confirm('{{"真的要删除吗？"|T}}');"><i class="fa fa-times"></i></a>
										</td>
									</tr>
                                    {{end}}
								</tbody>
							</table>		
							</div>
							{{Stored.pagination.Render}}
						</div>
					</div>				
				</div>
			</div>
{{/Block}}